package com.itlong.cloud.commons.dao;

import com.itlong.cloud.POJO.VO.app.AppUserAndRoomInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <desc>
 *      更新用户和房间欠费状态数据库访问接口.
 * </desc>
 *
 * @createDate 2019/1/22
 */
@Mapper
@Repository
public interface IUpdateUserAndRoomForbiddenStatusDao {

    /**
     * <desc>
     *      更新用户和房间欠费状态
     * <desc/>
     *
     * @param   feeId 账单ID
     * @author Juguang.S
     * @createDate 2019/01/22
     */
    List<AppUserAndRoomInfoVO> getForbiddenInfo(@Param("feeId") String feeId);

    /**
     * <desc>
     *     批量修改已交物业费的用户的欠费状态
     * </desc>
     *
     * @param userIdList 用户id集合
     * @return 受影响的行数
     * @author Juguang.S
     * @createDate 2019/01/22
     */
    Integer updateUserStatus(@Param("userIdList") List<String> userIdList,@Param("projectId") String projectId);

    /**
     * <desc>
     *     批量修改已交物业费的房间的欠费状态
     * </desc>
     *
     * @param roomIdList 房间id集合
     * @return 受影响的行数
     * @author Juguang.S
     * @createDate 2019/01/22
     */
    Integer updateRoomStatus(@Param("roomIdList") List<String> roomIdList);

    /**
     * <desc>
     *     查询用户在该项目下还有欠费的房间
     * </desc>
     *
     * @param userId 用户ID
     * @param projectId 项目ID
     * @return 受影响的行数
     * @author Juguang.S
     * @createDate 2019/05/31
     */
    Integer isUserArrearageProject(@Param("userId") String userId,@Param("projectId") String projectId);

    /**
     * <desc>
     *     查询指定房间下是否还有未缴费的账单
     * </desc>
     *
     * @param roomId 房间ID
     * @return 受影响的行数
     * @author Juguang.S
     * @createDate 2019/06/04
     */
    Integer isArrearageByRoomInfo(@Param("roomId") String roomId,@Param("projectId") String projectId);
}
